package com.xingdata.jjxc.adapter;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.net.wifi.ScanResult;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.xingdata.jjxc.R;

public class VlanListViewAdapter extends BaseAdapter {
	private ArrayList<ScanResult> arrayList;
	private Context mContext;
	public VlanListViewAdapter(ArrayList<ScanResult> arrayList, Context context) {
		this.mContext=context;
		this.arrayList=arrayList;
	}




	@Override
	public int getCount() {
		return arrayList==null?0:arrayList.size();
	}

	@Override
	public Object getItem(int position) {
		return arrayList.get(position).capabilities;
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder;
		if (convertView == null) {
			holder = new ViewHolder();
			convertView = LayoutInflater.from(mContext).inflate(R.layout.vlan_listview_item, null);
			holder.address_title = (TextView) convertView.findViewById(R.id.vlan_name);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		holder.address_title.setText(arrayList.get(position).SSID);
		return convertView;
	}
	
	private class ViewHolder {
		TextView address_title;
		
	}

}
